Function.prototype.myCall = function(context) {
    /** 判断调用对象 */
    if (typeof this !== 'function') {
        throw new TypeError('Error')
    }
    /** 获取参数 */
    let args = [...arguments].slice(1);
    context = context || window;
    context.fn = this;
    var result = context.fn(...args);
    delete context.fn;
    return result; 
};

let obj = {name: 'wzj'};
console.log(Object.prototype.toString.myCall(obj));
                                                                                                                                                                  